#ifndef WORKERTHREAD_H
#define WORKERTHREAD_H

#include <QThread>
// #include "mainwindow.h"
extern "C" {  
    int runSampleVIRVI2VO(const char *configFilePath);
}  

// 自定义工作线程类
class WorkerThread : public QThread {
    Q_OBJECT
public:
    WorkerThread(const QString &configPath) : mConfigPath(configPath) {}

protected:
    void run() override {
        int result = runSampleVIRVI2VO(mConfigPath.toStdString().c_str());
        emit resultReady(result); // 发射信号返回结果
    }

signals:
    void resultReady(int result);

private:
    QString mConfigPath;
};

#endif // WORKERTHREAD_H
